#!/usr/bin/python
# Filename: ex_DSIntro_1_2.py

# find max value in the list, pay attention to PHs.
# also be aware that the max value can be several.

l = (4543.9, 4543.9, 3, 45, 654.7, 7, 66, 35, 45, 4, 6, 4543.9, 5, 46, 54, 6, 43, 5.980, 34)
l_pos = [-1] * len(l)

pos = 0 # l_pos[0] is a PH for pos, bcz there must be a max value
curr = 1
for i in range(1, len(l)):
    if l[i] > l[pos]:
        pos = i
        curr = 1
    elif l[i] == l[pos]:
        l_pos[curr] = i
        curr += 1

l_pos[0] = pos # there will be an error when l is empty
if curr < len(l)-1: # should be len(l)-1, not len(1) as in answer
    l_pos[curr] = -1

for i in l_pos:
    if i != -1:
        print i,
    else:
        break
